import { TPetSkills } from "../../../Message/Db/Tables/TPetSkills";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class PetSkillsConfig
    
    export  class PetSkillsConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (PetSkillsConfig._instance != null) 
            {
                throw new Error(" PetSkillsConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TPetSkills();
                loc1.id = loc2.id;
                loc1.skillsStr = loc2.skillsStr;
                this._map[loc2.id] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_pet_skills.json");
            this.write(loc1);
            return;
        }

        public getInfoByCode(arg1: int): TPetSkills
        {
            return this._map[arg1];
        }

        public static get instance(): PetSkillsConfig
        {
            if (PetSkillsConfig._instance == null) 
            {
                PetSkillsConfig._instance = new PetSkillsConfig();
            }
            return PetSkillsConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: PetSkillsConfig;
    }
